<template>
<span class="opera_model-wrapper">
  <button v-if="col.btns.DELIVERY && delivery_status==0 && is_check == 0" class="ui button primary mini" @click.stop.prevent="delivery(col.val,col)"
          title="发货">{{col.btns.DELIVERY}}</button>
  <button v-if="col.btns.AUDITFC&&pay_status==1&&delivery_status" class="ui button primary mini"
          @click.stop.prevent="auditfc(col.val)"
          title="审核分成">{{col.btns.AUDITFC}}</button>
      <button v-if="col.btns.SHOWDETAIL" class="ui button primary mini"
              @click.stop.prevent="showDetail(col.val)"
              title="查看详情">{{col.btns.SHOWDETAIL}}</button>
</span>
</template>
<script>
    import tool from 'src/util/tool';
    import util from '_util/index';
    import logic from '_logic';
    export default {
        data() {
            return {}
        },
        methods: {
            delivery(id,col){
                /**
                 * 触发mypop.vue下showPopCom监听事件 显示spDelivery模板 显示发货信息
                 * */
                this.$store.state.global.eventVue.$emit('showPopCom',{_this:this, id:id,name:'spDelivery',data:{deliveryShow:true,operateShow:false}});
            },
            showDetail(id){
                /**
                 * 触发mypop.vue下showPopCom监听事件 显示spDelivery模板 隐藏发货信息
                 * */
                this.$store.state.global.eventVue.$emit('showPopCom',{_this:this, id:id,name:'spDelivery',data:{deliveryShow:false,operateShow:false}});
            },
            auditfc(id){
                /**
                 * 触发mypop.vue下showPopCom监听事件 显示spAuditfc模板
                 * */
                let url = tool.getApi(this, 'Op', 'audit_fc');
                let param = {
                    id: id
                };
                util.http.SR(this, url, param, '审核成功', (rs) => {
                    logic.list.refreshListData(this);
                });
            },
        },
        computed: {
            ctl(){
                return this.$route.query.ctl;
            },
            delivery_status(){
                return logic.detail.getDetail(this, this._id,'delivery_status').val;
            },
            pay_status(){
                return logic.detail.getDetail(this, this._id,'pay_status').val;
            },
            is_check(){
                return logic.detail.getDetail(this, this._id,'is_check').val;
            },
            is_admin(){
                return util.is_admin(this);
            },
        },
        watch: {},

        props: ['col', '_id', 'detail_info'],
        created() {
        },
    }
</script>
<style rel="stylesheet/less" lang="less"></style>
